package com.java.oop;

public class Teacher extends Person{

    private String course;

    public Teacher(){
        System.out.println("Teacher无参构造");
    }
    public Teacher(String name, int age, String gender, String address) {
        super(name, age, gender, address);
        System.out.println("Teacher的有参构造");
    }

    @Override
    public void speak() {
        System.out.println("同学们好");
    }

    public String getCourse() {
        return course;
    }

    public void setCourse(String course) {
        this.course = course;
    }

    public void teach(){
        System.out.println("开始上课, "+this.getName()+"开始讲"+this.course+"课了！");
    }

    public static void main(String[] args) {
        Teacher teacher = new Teacher("李老师",22,"男","武汉");
        teacher.setName("李老师");
        teacher.setCourse("java");
        teacher.speak();
        teacher.teach();
    }
}
